package com.sccba.uop.demo.common.constant;

public enum ResponseBodyField {
    CODE("uop_code"),
    MESSAGE("uop_msg"),
    DATA("uop_data");

    private final String name;

    ResponseBodyField(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public ResponseBodyField from(String val) {
        ResponseBodyField[] values = ResponseBodyField.values();
        for (ResponseBodyField value : values) {
            if (value.name.equals(val)) {
                return value;
            }
        }
        return null;
    }

    public boolean eq(String val) {
        if (val == null || "".equals(val)) {
            return false;
        }
        return this.name.equals(val);
    }
}
